<div class="sidebar">	
	<div class="widget widget-category">
		<h3 class="title"><?php __('Post categories'); ?></h3>
		<ul>
			<?php $categories = $this->requestAction('/posts/posts/category/10'); ?>
			<?php foreach ($categories as $category):?>
			<li><?php echo $html->link($category['Category']['title'], array('plugin'=>'posts', 'controller'=>'posts','action'=>'index', $category['Category']['slug'])); ?> <?php if(isset($category['Post'])):?>(<?php echo count($category['Post']); ?>)<?php endif;?></li>
			<?php endforeach; ?>
		</ul>
	<?php echo $html->link(__('See all categories', true), array('plugin'=>'posts', 'controller'=>'posts', 'action'=>'category'), array('class'=>'action-link')) ?>
	</div>
	
	
	<div class="widget widget-posts">
		<h3 class="title"><?php __('Latest posts'); ?></h3>
		<ul>
			<?php $posts = $this->requestAction('/posts/recentposts/6'); ?>
			<?php foreach($posts as $post): ?>
				<?php $data_str = ' <span class="date">' . $time->niceShort($post['Post']['date']) . '</span>'; ?>
			<li><?php echo $html->link($text->truncate($post['Post']['title'], 25, '..') . $data_str, array('plugin'=>'posts', 'controller'=>'posts','action'=>'view', $post['Post']['slug']), null, null, false) ?></li>
			<?php endforeach; ?>
		</ul>
	<?php echo $html->link(__('Go to archive', true), array('plugin'=>'posts', 'controller'=>'posts', 'action'=>'archive'), array('class'=>'action-link')) ?>
	</div>

	<div class="widget widget-rss">
		<h3 class="title"><?php __('RSS feed'); ?></h3>
		<ul>
			<li class="rss-feed"><?php echo $html->link(__('RSS feed of posts', true), array('plugin'=>'posts', 'controller'=>'posts', 'action'=>'feed', 'ext'=>'rss')); ?></li>
		</ul>
	</div><!-- End rss-widget -->
</div>





